Skip to main content

Full text of "Fortran: Compatibility and Standardization"

See other formats



Prepared by the chairman of the American Standards Assn, 
committee charged with the responsibility of devel op g 
FORTRAN standards proposals, the fol owi g 
.ended not as a progress report an the work of that coa 
minee bat rather as some conclusions-based on two years 
^ involving mas, of the principal Ameren co = 

sarza sz 

accomplished in the FORTRAN area. 

■ Several aspects of FORTRAN history, or pro- 
gramming Unguage standardization and of stand- 
ardization generally must be kept m mind 
1 FORTRAN, although initially used on the IBM 
704 gradually became available for many machines pro- 
by many manufacturers Two f-'or^are probably 
primarily responsible for the fact that FORTRAN just 
crowed " Firstly. FORTRAN was inherently well suited 
t„ making programming easier for the non-professional 
open shop user, and secondly FORTRAN could enor- 
mously reduce the reprogramming difficulties m «mv«h ’ - 
rng from one machine to another. In the early stage of 
FORTRAN history, compatibility was definitely sc 
ary so that additions or modifications to the language 
were made rather light heartedly by new compiler writers 
on the basis of personal preference. Later, the p '"jP or,a 
of compatibility considerations was more clearly recog 
nized as a result of the growing investment in existing 
. FORTRAN programs by users, and a definite stablhz - 
lion of the language set in, although the language con- 

U T d Untif«96 2 . When the X3.4.3 FORTRAN standards 
Committee was formed, there existed no organized channel 
of information interchange. This is actually qulte asmn. 

ishing considering the very widespread use of I 
The situation was unlike that of any other widely used 
common programming language. In order todefme 
FORTRAN standard (s) , it was necessary 
the various existing "FORTRAN practices. After » 
change of FORTRAN programming manuals, it soon 
became evident that they were all incomplete. Question 
could lie asked that could not be answered from study- 
f,7 the manuals of individual FORTRAN systems 
Fortunately, most of these questions could be ar,s *"^. 
by someone already familiar with a particular FORTRAN 
-although some questions arose that required e t er 
user tests or compiler authors to go into their own code 
to determine the answer. 

3 The June issue of Datamation contained an un- 
attributed statement estimating that the investment in 
FORTRAN currently is 214 to $5 billion. That hg 
seems to me to be much tpo high. I have not been 
able to find any survey information containing the type 
of data on which to base a careful estimate, but the 
value of FORTRAN programs in use is undoubtedly very 
substantial. Accordingly, in FORTRAN standardization 
the approach called for is not to go off and design a 
new improved language, but rather to stick to existing 

practice, although where current usage is conflicting, a 

definite choice must be made. . , tn _. 1 

4. No American Standard programming language 

guarantee interchangeability ’ of FORTRAN programs 
g ™ mar hinesy" The judgment was unammous-No! The 

ZZJH! <S "•*»»’ 

of hardware, and (b) improperly written FORTRAN 

^Compatibility: The expression, "machine independent, 
language has come into vogue in recent years and it 
has 8 seemed to me that it is often used carelessly-as if 
to imply some fundamental or theoretical distinction 
between "machine" and “machine mdependent pro- 
cramming languages. All so-called "machine independent 
programming languages that are really complete are in 
fact, the machine language of an actual computer that 
hasn’t yet been built, but such languages could be directly 
and cornpletely realized in hardware. The fact that such 
machines^ haven't been built relates to economic feasi- 
bly and performance— thus the distinction between 
“machine independent” and machine dependent lan- 
guages is practical, not theoretical. In fact, a little ‘bought 
Cs that a compiler establishes the interdependence be- 
ween a “machJ independent" language and a machine 
language. A language that is truly independent of a 

machine is also a "machine irrelevant languag^The re l 

compatibility difficulties arise from the fact that Fun 
TRAN like other so-called machine independent la 
uages 'is a delilierately incomplete machine language m 
this case, of the “FORTRAN machine. In such areas as 
precision, range, storage, number and nature °f I/O 
vices it seems unwise to completely specify the FOR 
TRAN language in order to permit practical, efficient, pro 
crammed “realization” of the "FORTRAN machine by a 
varietyof actual computers. Thus, a FORTRAN program 
can bl dependent for its intended operation on such factors 

Mr. Helling It manager of Pro- 
gramming Technology In IBM't 
Data Syitemi Dhr. Joining the 
firm In 1950, he hat been en- 
gaged In Much areai ai auto- 
matic coding tyitemt, comput- 
er del Ign and ute, at well at 
advanced programming sys- 
temi planning. He wai former- 
ly a radio engineer with RCA 
labt, and an Inttrudor In 
physics. He holds a degree In 
chemical engineering from Cor- 
nell and an MA In physics from ; # 

puter • 
16ft tin 
the sc 
take t 
to tx* 
art to 
to he 
— 5om« 
of th* 



which are deliberately left ambiguous in the FORTRAN 
language, and thus program transferability cannot be 

^'improper FORTRAN Programs: Strictly speaking,, one 
might take the point of view that the action of a com- 
puter on improper FORTRAN programs may be simp y 
left unspecified— as being irrelevant and rightfully outside 
the scope of any standard. It has been necessary to 
take this point of view, but only because it appears 
to lie bevond the current state of the programming 
art to specify “complete" diagnostics and know that goal 
to Ire practically realizable. Improper FORTRAN pro- 
grams in specific implementations often do useful things 
-sometimes unintended by the compiler builder-anil 
deliberate or inadvertent use may be made of such 
-features." this limiting FORTRAN compatibility. Many 
of the idiosyncrasies of FORTRAN have arisen directly 

from such historical accidents. The only bright spot in 
leaving "improper" FORTRAN programs undefined is that 
the way is left open for useful additions to tie made 
deliberately to the language by implementors without 

necessarily being thereby "non-standard. Thus the growth 

'•of FORTRAN is allowed for, but on the other hand, a 
potential source of new incompatibilities remains. 

In conclusion, a FORTRAN standard will not bring 
the millenin m; it will facilitate but not guarantee inter- 
changeability of programs between machines Neverthe- 
less. it is believed that a useful purpose will lie served 
by identifying and describing much FORTRAN folklore, 
and thereby reducing the incompatibilities arising inadvert- 
ently through misunderstanding. However, many conver- 
sing problems will still remain, and cries of dismay over 
"inadequate FORTRAN diagnostics will lie heard through 
the land for some time to come. 




FORTRAN, the "universal" programming lan- 
guage, is indeed universal, or at least, nearly so. 

Of 13 FORTRAN compilers, 16 are listed in 
the accompanying comparison matrix. There is no doubt 
that more programmers can write and more machines can 
compile it than any other programming language. More- 
over, on the surface, it appears that all_ these are the 
same— i.e„ that each will accept a FORTRAN pro- 
gram written for any other. This is not true. We will 
demonstrate, by means of the FORTRAN Language 
Characteristic/Co, npilcr Comparison Matrix, some of the 
variability in the language and some consequent mcom- 

patibilities. . . . 

It is widely held among programmers and other com- 
puter knowledgeable people that FORTRAN is a means 
to compatibility among different machines It is gen- 
erallv accepted and often stated that any I ORTRAN pro- 
gram written for any particular machine can, with only 
“minor" changes (usually in I/O statements), be com- 
piled on some other machine and produce running 
code. The statement is true, but only for some prograim 
and over a limited set of compilers. If. several FORTRAN 
compilers admit differences in source language, then only 
programs that employ those language features that rep- 
resent the intersection of the languages can lie compatible. 
Even if the intersection of language features is used, 
compatibility is not assured, for built-in features. e.g„ 
maximum number range, over which the user has no 
control, can destroy compatibility. 

Basically all FORTRAN look alike. All have arith- 
metic replacement statements the DO, IF 
Real and Integer constants and variables C.O 1U, FUR- 
MAT, I O statements, etc. The form of each statemen 
is for the most part, universal. The differences lie Ik** 
hind this facade of uniformity. The real differences are 
subtle (often truly minor) but there are many such dilter- 

'ences, and their total impact tells the story of the 
universality or compatibility of FORTRAN. 

About a year ago, the problems of programmers in 
the use of manuals, particularly the extraction o infor- 
mation from manuals, led the author to consider the 
creation of Infograph « (Fig. 1). Infograph makes use 
of the quick-find features of the mechanical list finder 
to eliminate the necessity of thumbing through a con- 
ventional manual. Since the amount of space available , 
in an Infograph is limited, whatever information that is 
to l e displayed must be concise, brief, and readily, 
assimilable. It was decided to develop a FORTRAN In- 
fograph since such a device might appeal to a large 

K t (Text continues on page 2h) 

Mr. Oswald it president of 
Ce/estron Assoc. Inc., a soil- 
ware firm In Yonkers, N.Y. He 
is both a physicist and system 
analyst with extensive pro- 
gramming experience In both 
applications and machines. He 
Is also a consuhant In the de- 
velopment of software for a 
mass memory-centered proces- 
sor to be used in non-numeric 
language processing. He holds 
a BS and PhD In physics from 
New York Univ. 

, August 1964 

si SSISii H 2 22 2>S 

lo v iii «n _ m m < 

*4,® ®°«®® 

>->->- >z>-» 

o> ~ 

°l I 

. O* t 
® 0 > ' M 
^5 VI c 
E c o 2 
O O 3 VI Z C 

is SzSSlI 


£ ® ® ® ° ° ° ® ° co e o 

•S££.>-zzz>- z W>Z 

. C7> . _ 

to* • 
avi o 2 

E c z.§ 

0 0 3*1 w 

in in v* O n o 
>>>- ZZ 



cc z E 5 5- 

oSS 003V, -8 I £ 

C4» ZZZo “■ 

w ®« 

•22 £ 
r*» fo 2 

E coa 

S s i 2 ij 2 

XIVI ° 2 * 2 ® £ 
Ec z H -oEo ■ 

55 « IzzS ’ IS 2 5 

t os's ls?S?B 8 « 

i <8 I s |v.°l Ms l^tsis 

: 1 SSS.....I o „« Ills 8 H1J|5I§S5S= 

!««»•« ^ fjjzzzzza z n>>- w‘o 

*« *J«;;izzz * z* 2 >s "i" “* 

. a 
oj E 

®WI ° * 

fc z s 
mSS !S=^ - 

illjzzz; z aft 

> O.- . 

— I "Z 3 

■ ct« o 

E — > c ® 

— C TJ * ® J 

't-o ®®£ ® 

“ = ® ° 

» 000 »« °" oil s s s s=s s £•;?;! 

u zzz >> O Z>-Q — — ® 


SJIsvi c 

! g M Eo h£ 



z^£w 5 wwq. 

I -o a 

; c £ 

-<z>~£ o o 

( -V~<S,0 r~ ' 

(K ■£ § 

£ I®® <■>*« 

- 1 : Sg 

"z * 

^kO HO 
;Z <oz<o c 

I UJ c 

-TD-*. _ Cg J 

.? 54 

!ss • ¥ ®S* 5 ^— P°-il 

! llls cc s* °s 



p !*-0 HO 

9 a X ffl ® O ^ 3 

It ! c cj ! 55 i 

a® « c •■o£ 52 3 

Jr =,«!• E?-! “• « 

y .O — ,. S 

Z ES **.? 

— 3 “ «0 

5z5 Si 

< 2«S K !« Eft g ■2i®ag550E|E®J522 

SiiHmu S®*«* I F g5 Mli”ir s l 

L(/)UIU. “ 


tfBA S « tS Z 


FORTH \N milium! procedure of explanatory paragraphs 

f -7’f « p ir:: £ 

STkI/T «f «catio,,am. explanaHon 

followed l.y a few spt-c-il.c- examples. Tin result 
concise description of tlie lannuage. . ,. 

When 7090 FORTRAN II luul. been successfully rc- 

wr for InfnRraph, we decided to cln ck sexeriil I OH 

IIUN compilers to ascertain whether the Intograpn 
sersiou would be useful to all FORTRAN programmers. 

It was discovered that the differences were sufficient > 
important that no single version of the language could 
possible lie used lie all programmers. 

Accordinglv the project preceded on a much broade 
Insis through a careful analysis. of the compilers nancil 
i,‘, the comparison matrix. Folfowing the analysis, the 
FORTRAN InfoRrapb was .redesigned. Infograp 
represents essentially the union of FORTRAN, m that 
all the basic features are present and provision is mac e 
displav special features for particular machines. In 
addition, a “specializer" is supplied with each InfoRrapb 
The specialize, permits .be user by making a senes of 
simple modifications keyed to the standard eon emts o 
specialize, bis InfoRrapb for a particular machine. Die 

FORTRAN InfoRrapb, then. loRetber will, the set ol 
speeializers, reflects the FORTRAN language now in use 
The FORTRAN Language Characteristic / Compiler 
Comparison Matrix attempts to illustrate some oftbe 
actual differences between the compilers. No ■ <"P‘ 
was made to include all tile variables; in fact, the 
language characteristics presented were chosen because 

llTeasy to use the Fortran Infograph. Move the Infograph 
Subject Selector to the Cover Index line that best describes 
the Fortran information desired. 

they seemed to represent the more important differences 
without becoming tediously detailed. rhnracter- 

Witbout attemptinR to discuss each lanR . R • • 
istic in detail, some comment is required to fill in tie 
tween the lines. For the most part we leave judgment 
to the reader; we consider that the comparison matrix 
represents a reportorial effort rather than a critical evalua- 

,i0 The following paragraphs each refer to an entry under 
the language characteristic column of the comparison • 


"eoTand 3f«)0 Tlds particular FORTRAN allows sub and 
super word variables, I O buffer definition statements and 
code conversion statements, among other features. One 
m, ion of language content can be had by comparing 

the number of non I/O statements (separated by a 

slash from the maximum number). Thus, tor exampi 
C1X- uses -14 statements on the CDC 1604 while Honey- 
wcdl uses nine statements on the H200. Both belong to 

,J5h„ !»• haKlware preM™, '■ 

^^“.W’numbere is one of the items that 
displays a great deal of variety Integers are represented 
by up to 14 or as few as three decimal digltsThese 

hesd "mrnber"' arc represented by as few 
( s : ,wo up to as many as 10 decimal digits; the sma les 

10 -»oo< r <10'> no on the other extreme. From the view- 
point of compatibility such variation can raise havoc 
with otherwise compatible programs. Consider for^ex- 
ample the. inversion of an ill-formed rnatri 
small differences between large numbers become sign f- 
icant A program that runs well on one machine would 
not run at all when recompiled simply because the 
number range is exceeded. This sort of non-programmer 
controlled incompatibility would be missed by trans- 
Fitors” (F-Il to F-IV) patterned after LlfT or Ml 1. 

The PB 440 outclasses all others in the naming e P ar 
ment allowing variable names up to 80 characters 
cue h However if one wanted to write a program 
, hat is compatible across the board (as far as _ variable 
naming Roes) one would 1* limited to i four ^charac M 
Double precision and complex arithmel c are very 
special features usually not available. Note, however 
that even where DP is available the number of digits 

^Subscripts range from a minimum of two to ^maxi- 
mum of any numlier. In some cases subscripts may be 
Tn ep-r Expressions^ and in others any Expression Sub- 
script may sometimes be subscripted to any .level, but 
usually mav not be subscripted at all. 

All FORTRAN allow exponentiation, multipbcatio , 
vishlii ^addition and subtraction. Relational operatums may 
he used to relate arithmetic quantities; however, they 
not usually available. The logical operators are available 
only in FORTRAN IV and the Boolean operators are 
r,re In one case Function reference is not available. 
Again “across the board" compatibility wouW require 

"ire jzszanu-i* 4 
t-±wr sfSfe « sssas s 

I nerniits mixed expressions with'out restriction. The same 
I FORTRAN allows multiple replacement statements (one 

I hut* with several = operators), each segment of which 



may be of a different type. Confusion is eliminated by 
establishing a type hierarchy. 1^1^ " 
with single valued variables, i.e., .THUh., . • 

or 1,0 while Boolean expressions deal with data fields 

such as, say, a 36-bit machine word. 

The ASSICN and Assigned CO TO often are not 
available. In a few cases the list of possible successor 
choices is not necessary. ... . T i nro 

Logical IFs are found in FORTH AN IV only. There 
is considerable variation in the availability and ,ntel T r «- 
tation of Hardware IFs. Note that the F-IV subroutines 
(SSWTCH, etc.) that are to replace Hardware II s are 
not uniformly used among F-IV compilers. mnT niM 
The DO statement is identical in many FOR RAN 
but there are exceptions. The Univac 1107 will conn a 
DO index in reverse if the initial value is greater than 
the final value. CDC and TRW will skip execution undr-r 
the same conditions, all the rest will execute the DO loop 
once except RPC 4000 which wont allow the condi- 
tion in the first place. The DO index must be an Integer 
Variable while the initial, final values andinertmen 
miv be Integer Variables or constants.— The above is 
Trim el'pTZ SDS 900. RFC 4000 and PB 440. SDS 
allows the index to lie any variable. All three allow the 

parameters to be any expression. 

All versions allow PAUSE. STOP is usually an exit 
to an operating system (if one exists). END is sometimes 
not required and sometimes performs the function of 

The ability, to vary the dimensions of an array in a 

Subroutine is rare. 

The Format arguments include those which are m 
variable. Most FORTRAN allow P scaling. The I/O ot 
Hollerith text with and without processing capability is 
mostly available. Logical variable I/O is rare. 

The I/O statements reflect hardware realities. The mag- 
netic tape statements are used by some of the smaller 
machines to control unusual I/O devices (e.g., plotter, 
etc.). A great variety of I/O statements exists, much 
creator than indicated in the comparison matrix. 

FORTRAN II permits EQUIVALENCE to reorder 
COMMON, for the most part, while FOR IRAN IV 

"Functions are at once the most flexible and rigid ele- 
ments of FORTRAN. Among built-in and library func- 
tions,' names vary slightly over several versions n this 
department Univac 1107 wins the prize with 73 built-in 
and library functions. Function naming for statement 
and subprogram functions seems always to have lieen 
a problem. Thus, function name classically must be 4 
to n characters ending in F or not if less than 4. The 
FORTRAN II I, J, etc., first character rule applies. 
Some F-II versions attempt to simplify the naming rule. 
F-IV obviates the rule by use of Type and T /P e 
statements. The CDC 160 and 160A and the :T RW 330 
allow no statement or subprogram functions, the 160 does 
not have built-in functions. _ ■ . 

The DATA statement and BLOCK DATA subroutine 
are, of course, available only in F-IV to supply initial 
data at compile time. 

Type declaration is also only available ill F-IV. lit 
F-II naming rules (i.e., Integer I, J, K, L, M, N if 
first character of a name) still hold but may lie over- 
ridden by a Type declaration. 

Statements are usually identifiable by number. The 
two most frequent maximum statement number values 
are 32,767 and 99,999. 

Several compilers allow symlrolic naming of statements. 
Pliilcn 2000, RPC 4000 and PB 440 allow names. The 
' introduction’ of statement names has quite an effect on 
the entire language for all statements that contain ref- 

erences tp other statements must allow names rather 
than numbers. ' : , , c ' „ 

FORTRAN Deck ordering involves a lodgment. Some 
compilers (e.g., Honeywell “Automath for H 800 H 
1800 and H 400) require not only special ordering ot 

statement categories but the insertion of special co^rol 

cards and multiple pass compilation. It should be noted 
that so insignificant a point as the organization of a 
source deck can mean no compilation when moving 

to another machine. . f 

Under special features are listed a few of the interest- 
ing departures from the "universal” FORTRAN. Features 
are merely listed without attempt at explanation. 

The Comparison Matrix indicates the variability of 
the language. We have little or no information on com- • 
piler efficiency (time to compile), object program effi- 
ciency (time to run), hardware configurations, etc. The 
information presented here was taken directly from the 
manuals supplied by the various manufacturers. 

One is tempted to ask: Why these differences? There 
is no single cause. Certainly the basic hardware d ffer- 
ences make their contribution. Some compilers differ from 
others because of misinterpretation or a desire to inv 
prove upon what exists. It is possible to extend FORTRAN 
and thereby make it more suitable as a data processing 

tool. The reading of Hollerith text “"^'p/nFCODE 
statements in CDC FORTRAN 63 are examples. Non 
compatibility is also a potential sales tool. Civen a class 
of machines, one competitor can write language speci- 
fications that would permit the proper cornp.lation of 
programs from the competing machines but effectively 
prevent reverse compatibility. This can be done by adding 
one or more features that the competitors do not have. 
Symbolic statement names would be a likely feature for 
this purpose, some unique form of subscripts would be 
another; the idea is to supply a feature that programmers 
will use frequently. The language specification will then 
call for the union of the competing languages plus the 
special, non-common features. Thus all competing pro- 
grams will compile but programs written m ,he 5 I ,e *r 
language will in general, be incompatible with he 
competing machines. We do not suggest that any of the 
FORTRAN included in this study were dictated by 
marketing considerations. Nevertheless several compilers 
have characteristics that cause them to behave in the 

manner jJfct descrilied above. FORTRAN 

The “universal" programming language, FORTRAN, 
is indeed universal but not all dialects are the same. We 
have presented some of the differences in the language 
and their effect on compatibility of FORTRAN pro- 
grams. 1*o those engaged in writing codes intended l to be 
compatible with another machine now or in the future, 
cautfon is suggested. Such “compatible Prcparnming 
requires great care and foresight. A practical result of 
Z ihidy has-been the FORTRAN Infograph, which 
together with its detailed specializer should be»se fu l 
. • i i oppiiratp rpference For any 

together witn us aeiaiicu , nnxt 

astboth a handy, fast and accurate reference for any 
FORTRAN user, and also as a kind of panorama of 

the “universal” language. m \ ,. 

The author wishes to acknowledge the "niior contnbu- 
tion of C. L. McCarty, Jr., who together with the author, 
examined in detail, extracted and organized tlm basic 
information from the manufacturer* ™"> ia ' s 
efforts of Mr. McCarty and F. J. Oswald in 1*"°™ 
ance of various functions leading to the Infograph and 
this paper are also acknowledged. The following com 
panics have cooperated by supp ying nrjimialsi IBM 
UNIVAC CDC, Phileo, Honeywell, Scientific Data hys 
terns Ceneral Precision, Packard-Bell, RCA, Autonetics, 
CE and TRW. 

4i 1 pint 1064